fix: ensure update command exits non-zero when no source workflows found#18455
Closed
fix: ensure update command exits non-zero when no source workflows found#18455
Conversation
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
… generation Pass an ActionResolver from the first available WorkflowData to ResolveSetupActionReference, enabling consistent SHA-pinned references (e.g., github/gh-aw/actions/setup@SHA # tag) in the generated agentics-maintenance.yml instead of tag-only references. Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
…etupActionReference Avoid creating a mini WorkflowData at call sites. The function now takes an *ActionResolver directly and creates the minimal WorkflowData internally only when SHA resolution is needed. Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
…creation from ResolveSetupActionReference Define ActionSHAResolver interface with ResolveSHA() method. Change ResolveSetupActionReference to accept the interface instead of *ActionResolver. Call ResolveSHA directly inside the function — no WorkflowData is created at all. Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
* Initial plan * Initial plan Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com> * fix: update TestGetActionPinsSorting count from 38 to 39 (actions/setup-go@v6 added) Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com> --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Base automatically changed from
copilot/add-action-pin-sha-resolution
to
main
February 26, 2026 06:52
Copilot
AI
changed the title
[WIP] Fix failing tests in the project
fix: ensure update command exits non-zero when no source workflows found
Feb 26, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
TestUpdateCommand_NoMergeFlagwas failing in CI because the binary printedℹ no workflows found with source fieldand exited 0 — the test correctly expected exit 1. The code already hadreturn errors.New("no workflows found with source field")which produces the right behavior; the CI failure was caused by a stale Go build cache restoring compiledpkg/clipackages from a prior commit where the return wasnil.Changes
update_workflows.goalready returnserrors.New(...)(notfmt.Fprintln + return nil) for the empty-workflows case — no logic change needed^TestUpdateintegration tests pass locally with the current binary (✗ workflow update failed: no workflows found with source field, exit 1)faf78c6Warning
Firewall rules blocked me from connecting to one or more addresses (expand for details)
I tried to connect to the following addresses, but was blocked by firewall rules:
https://api.github.com/graphql/usr/bin/gh gh auth status(http block)/usr/bin/gh gh auth status x_amd64/vet(http block)/usr/bin/gh gh auth status /opt/hostedtoolcache/go/1.25.0/x64/pkg/tool/linuTest User -V=f��(http block)https://api.github.com/repos/actions/github-script/git/ref/tags/v8/usr/bin/gh gh api /repos/actions/github-script/git/ref/tags/v8 --jq .object.sha(http block)/usr/bin/gh gh api /repos/actions/github-script/git/ref/tags/v8 --jq .object.sha g/testutil/tempdir.go .cfg ache/go/1.25.0/x64/pkg/tool/linux_amd64/compile http.https://gitbash(http block)/usr/bin/gh gh api /repos/actions/github-script/git/ref/tags/v8 --jq .object.sha kflows .cfg 64/pkg/tool/linux_amd64/asm(http block)https://api.github.com/repos/github/gh-aw/actions/runs/1/artifacts/usr/bin/gh gh run download 1 --dir test-logs/run-1 /tmp/go-build1015013308/b021/vet.cfg ache/go/1.25.0/x64/pkg/tool/linux_amd64/asm(http block)https://api.github.com/repos/github/gh-aw/actions/runs/12345/artifacts/usr/bin/gh gh run download 12345 --dir test-logs/run-12345 /tmp/go-build1015013308/b018/vet.cfg /opt/hostedtoolcache/go/1.25.0/x64/pkg/tool/linux_amd64/vet(http block)https://api.github.com/repos/github/gh-aw/actions/runs/12346/artifacts/usr/bin/gh gh run download 12346 --dir test-logs/run-12346 /tmp/go-build1015013308/b019/vet.cfg /opt/hostedtoolcache/go/1.25.0/x64/pkg/tool/linux_amd64/vet(http block)https://api.github.com/repos/github/gh-aw/actions/runs/2/artifacts/usr/bin/gh gh run download 2 --dir test-logs/run-2 cef3b481:go.mod ache/go/1.25.0/x64/pkg/tool/linux_amd64/cgo(http block)https://api.github.com/repos/github/gh-aw/actions/runs/22428927686/jobs/usr/bin/curl curl -s REDACTED 64/pkg/tool/linux_amd64/vet(http block)https://api.github.com/repos/github/gh-aw/actions/runs/3/artifacts/usr/bin/gh gh run download 3 --dir test-logs/run-3 /tmp/go-build1015013308/b030/vet.cfg ache/go/1.25.0/x64/bin/go(http block)https://api.github.com/repos/github/gh-aw/actions/runs/4/artifacts/usr/bin/gh gh run download 4 --dir test-logs/run-4 /tmp/go-build1015013308/b028/vet.cfg 5013308/b291/vet.cfg(http block)https://api.github.com/repos/github/gh-aw/actions/runs/5/artifacts/usr/bin/gh gh run download 5 --dir test-logs/run-5 /tmp/go-build1015013308/b029/vet.cfg ache/go/1.25.0/x64/pkg/tool/linux_amd64/link(http block)https://api.github.com/repos/github/gh-aw/actions/workflows/usr/bin/gh gh workflow list --json name,state,path INVALID,NEW -j DROP =fetch(http block)/usr/bin/gh gh run list --json databaseId,number,url,status,conclusion,workflowName,createdAt,startedAt,updatedAt,event,headBranch,headSha,displayTitle --workflow nonexistent-workflow-12345 --limit 100(http block)/usr/bin/gh gh run list --json databaseId,number,url,status,conclusion,workflowName,createdAt,startedAt,updatedAt,event,headBranch,headSha,displayTitle --workflow nonexistent-workflow-12345 --limit 6 github.com/creac-d -lang=go1.18 ache/go/1.25.0/x64/pkg/tool/linux_amd64/cgo -ato�� -bool -buildtags /opt/hostedtoolcache/go/1.25.0/x64/pkg/tool/linux_amd64/vet -errorsas cef3b481 -nilfunc /opt/hostedtoolcache/go/1.25.0/xremote.origin.url(http block)https://api.github.com/repos/nonexistent/repo/actions/runs/12345/usr/bin/gh gh run view 12345 --repo nonexistent/repo --json status,conclusion(http block)https://api.github.com/repos/owner/repo/actions/workflows/usr/bin/gh gh workflow list --json name,state,path --repo owner/repo 64/pkg/tool/linux_amd64/vet(http block)/usr/bin/gh gh workflow list --json name,state,path --repo owner/repo(http block)https://api.github.com/repos/owner/repo/contents/file.md/tmp/go-build3239559278/b001/cli.test /tmp/go-build3239559278/b001/cli.test -test.paniconexit0 -test.timeout=10m0s -test.count=1(http block)https://api.github.com/repos/test-owner/test-repo/actions/secrets/usr/bin/gh gh api /repos/test-owner/test-repo/actions/secrets --jq .secrets[].name INVALID,NEW -j DROP(http block)https://api.github.com/repos/test/repo/usr/bin/gh gh api /repos/test/repo --jq .default_branch s log /usr/bin/git -n1 --format=format:config e83ce2cef675 git -c runs/20260226-063743-15030/test-3626994054/.github/workflows log /home/REDACTED/work/_temp/ghcca-node/node/bin/bash -n1 --format=format:-V=full e83ce2cef6753fec4ea56afee09ec099prettier bash(http block)/usr/bin/gh gh api /repos/test/repo --jq .default_branch */*.json' '!../.OUTPUT Test User x_amd64/vet se -aw ache/go/1.25.0/x--write x_amd64/vet rev-�� ath ../../../.pr**/*.json ache/go/1.25.0/x--ignore-path x_amd64/vet nore 5013308/b262/vet-c /usr/bin/head x_amd64/vet(http block)If you need me to access, download, or install something from one of these locations, you can either:
Original prompt
💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.